//
//  TwERPGongdan.h
//  TwERP
//
//  Created by Xiangyang Li on 12-7-2.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <Foundation/nsdate.h>
#import "TwERPVehicle.h"
#import "TwERPEntity.h"
#import "TwERPLabourItem.h"
#import "TwERPPartItem.h"



@interface TwERPGongdan : TwERPEntity
@property (nonatomic,strong) NSString * gdNo;
@property (nonatomic,strong) NSString * category;
@property (nonatomic,strong) NSDate * receptionTime;
@property (nonatomic,strong) NSDate * wishFixedTime;
@property (nonatomic,strong) NSDate * fixedTime;
@property (nonatomic,strong) NSString * serviceAssistant;
@property (nonatomic,strong) NSString * problemDescription;
@property (nonatomic,strong) NSString * jywxxm;
@property (nonatomic,strong) NSDate * nextTime;
@property  int gls;
@property (nonatomic,strong) NSString * memo;
@property BOOL isJiesuan;

@property (nonatomic,strong)   TwERPVehicle * vehicle;
@property (nonatomic,strong) NSArray * labourItems;
@property (nonatomic,strong) NSArray * partItems;
@property (nonatomic,strong) NSArray * attachedFiles;

@property (nonatomic,strong) NSMutableString * vehSurface;


+ (TwERPGongdan *) createGongdanWithCphm:(NSString *)cphm;

- (NSArray *) photoFiles;
- (NSArray *) audioFiles;

- (float)sumOfLabourItems;
- (float)sumOfPartItems;
- (float)sumOfItems;

- (BOOL) prepairForEdit;
- (void) cancelEdit;
- (void) refresh;

- (TwERPLabourItem *)appendLabourItem;
- (TwERPPartItem *)appendPartItem;
- (void) addLabourItem:(id)lItem;
- (void) addPartItem:(id)pItem;
- (void) addAttachedFile:(id)aItem;

-(void) downloadAttachedFiles;
-(BOOL) uploadAttachedFiles;

@end
